package com.zjp;

import com.google.common.base.CharMatcher;
import org.junit.jupiter.api.Test;

public class CharMatcherTest {
    @Test
    public void t1() {


        String base = "ABC13456";


        // 匹配满足对应字符
        String s1 = CharMatcher.is('C').retainFrom(base);

        // 匹配数字
        String s2 = CharMatcher.inRange('0', '9').retainFrom(base);

        System.out.println(s1);
        System.out.println(s2);
    }
}
